var t = require("../../@babel/runtime/helpers/interopRequireDefault"),
  a = require("../../@babel/runtime/helpers/objectSpread2"),
  e = t(require("../../@babel/runtime/regenerator")),
  n = require("../../@babel/runtime/helpers/asyncToGenerator"),
  i = require("../../utils/lib/pixi.miniprogram"),
  s = t(require("../../utils/lib/unsafeEval")),
  o = require("../../utils/config"),
  r = require("../../utils/util"),
  d = require("./glsl"),
  l = require("../../utils/login"),
  h = require("../../utils/api"),
  u = null,
  c = getApp();
Page({
  data: {
    motto: "",
    isLogin: !0,
    isRender: !0,
    isShowRenderBg: !0,
    channel: "",
    landActiveImgMask: "",
    landCanvasImage: "",
    bgImage: "".concat(o.imgPrefix, "/static/assets/loading_bg.png"),
    msgBoxClassName: "left",
    guideImage: "".concat(o.imgPrefix, "/static/assets/icon_hand.png"),
    guideMoveImage: "".concat(o.imgPrefix, "/static/assets/icon_hand_move.png"),
    bgMsgBox: "".concat(o.imgPrefix, "/static/assets/bg_msg_box.png"),
    land: {
      landMsgImg: "".concat(o.imgPrefix, "/static/assets/land-msg/img_msg_1.png"),
      logoImg: "".concat(o.imgPrefix, "/static/assets/logo_YS.png"),
      landActiveImgMask: "",
      channel: "",
      status: "FarmStatus_Online",
      v_quota: 1e4,
      sold_quota: 0,
      price_rmb_fen: 0
    },
    inputNum: 10,
    maxNum: 100,
    isBlank: !1,
    isSubmitShow: !1,
    isMsgShow: !1,
    isShowBack: !1,
    isShowClose: !1,
    isGuideShow: !1,
    showGuideHand: !0,
    navBar: {
      statusBarHeight: 0,
      navigationBarHeight: 0
    },
    isLandAudioPlay: !1,
    isLandAudioLoading: !1
  },
  onLoad: function () {
    if (!wx.getStorageSync("token")) return this.setData({
      isLogin: !1
    });
    this.setData({
      isLogin: !0
    }), console.log("land load!"), wx.onMemoryWarning((function () {
      console.log("onMemoryWarningReceive-----")
    }))
  },
  onReady: function () {},
  onTabItemTap: function () {},
  onShow: function () {
    var t = this;
    return c.globalData.isShoHide ? c.globalData.isShoHide = !1 : (console.log("land->userPageFrom", c.globalData.userPageFrom), "" == c.globalData.userPageFrom && (console.log("show-land"), this.isRender = !1, this.showMaskAnimation = !1, this.showMoveAnimation = !1, this.isGuide = wx.getStorageSync("isGuide"), this.isReload = !1, this.setTopBar(), void setTimeout((function () {
      t.showLand()
    }), 50)))
  },
  setTopBar: function () {
    var t = wx.getStorageSync("statusBarHeight"),
      a = wx.getStorageSync("navigationBarHeight"),
      e = {
        statusBarHeight: t,
        navigationBarHeight: a,
        backTop: t + a - (0, r.createRpx2px)(34) - 5
      };
    console.log("navBar-----", e), this.setData({
      navBar: e
    })
  },
  onHide: function () {
    if (console.log("land hide"), c.globalData.isShoHide) return !1;
    this.land && this.land.shader && (this.land.shader.uniforms.mask = 0, this.land.showMask = !1), this.land && this.land.audio && this.land.audio.destroy(), this.setData({
      isBlank: !1,
      isSubmitShow: !1,
      isMsgShow: !1,
      isShowBack: !1,
      isShowClose: !1,
      isLogin: !0,
      isShowRenderBg: !0,
      isGuideShow: !1,
      isLandAudioPlay: !1
    }), this.landDestroy()
  },
  showLand: function () {
    var t = this;
    return n(e.default.mark((function a() {
      var n, i, s;
      return e.default.wrap((function (a) {
        for (;;) switch (a.prev = a.next) {
          case 0:
            n = wx.getSystemInfoSync(), i = n.windowWidth, s = n.windowHeight, t.init(i, s), console.log(i, s);
          case 3:
          case "end":
            return a.stop()
        }
      }), a)
    })))()
  },
  filterLandData: function (t) {
    return n(e.default.mark((function i() {
      var s, r;
      return e.default.wrap((function (i) {
        for (;;) switch (i.prev = i.next) {
          case 0:
            return s = {}, r = Object.keys(t), i.next = 4, r.forEach(function () {
              var i = n(e.default.mark((function n(i) {
                var r, d, l, h, u, c;
                return e.default.wrap((function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      (r = o.araeCodeStr["".concat(t[i].code)]) && (d = "".concat(o.imgPrefix, "/static/assets/land-active/land_active_mask_").concat(r, ".png"), l = "".concat(o.imgPrefix, "/static/assets/land-active/land_active_").concat(r, ".jpg"), h = "".concat(o.imgPrefix, "/static/assets/land-msg/img_msg_").concat(r, ".png"), u = t[i].sold_quota / t[i].v_quota * 100, c = "".concat(o.imgPrefix, "/static/assets/land-audio/audio_msg_").concat(r, ".mp3"), s[r] = a(a({}, t[i]), {}, {
                        baseAraeRGB: o.baseArae[r].araeRGB,
                        landActiveImgMask: d,
                        landActiveImg: l,
                        landMsgImg: h,
                        progress: u,
                        audioSrc: c
                      }));
                    case 2:
                    case "end":
                      return e.stop()
                  }
                }), n)
              })));
              return function (t) {
                return i.apply(this, arguments)
              }
            }());
          case 4:
            return i.abrupt("return", s);
          case 5:
          case "end":
            return i.stop()
        }
      }), i)
    })))()
  },
  getLandData: function () {
    var t = this;
    return n(e.default.mark((function a() {
      var n, i, s;
      return e.default.wrap((function (a) {
        for (;;) switch (a.prev = a.next) {
          case 0:
            return wx.showLoading({
              title: "前往何家岩农田",
              mask: !0
            }), console.log("fromArea:", c.globalData.fromArea), n = {}, c.globalData.fromArea ? (n.from = c.globalData.fromArea, n.ret_from = 1) : (n.from = "", n.ret_from = 0), a.prev = 4, a.next = 7, (0, h.getFarmsAPI)(n);
          case 7:
            i = a.sent, a.next = 19;
            break;
          case 10:
            if (a.prev = 10, a.t0 = a.catch(4), console.log(a.t0), wx.hideLoading(), 401 != a.t0.statusCode) {
              a.next = 16;
              break
            }
            return a.abrupt("return", a.t0.data);
          case 16:
            if (!a.t0.meta || 401 != a.t0.meta.code) {
              a.next = 18;
              break
            }
            return a.abrupt("return", {
              msg: "must login"
            });
          case 18:
            return a.abrupt("return", !1);
          case 19:
            return s = t.filterLandData(i.areas), a.abrupt("return", s);
          case 21:
          case "end":
            return a.stop()
        }
      }), a, null, [
        [4, 10]
      ])
    })))()
  },
  init: function (t, a) {
    var i = this;
    return n(e.default.mark((function n() {
      return e.default.wrap((function (e) {
        for (;;) switch (e.prev = e.next) {
          case 0:
            return e.next = 2, i.getLandData();
          case 2:
            if (i.landData = e.sent, i.landData) {
              e.next = 5;
              break
            }
            return e.abrupt("return", wx.showToast({
              title: "获取农田数据失败！",
              icon: "none",
              duration: 1e3
            }));
          case 5:
            if (!i.landData.msg) {
              e.next = 7;
              break
            }
            return e.abrupt("return", wx.showToast({
              title: "领养前请先登录！",
              icon: "error",
              duration: 1500,
              mask: !0,
              success: function () {
                wx.getStorageSync("token") && wx.removeStorageSync("token"), i.setData({
                  isLogin: !1
                })
              }
            }));
          case 7:
            return i.setData({
              channel: c.globalData.fromArea
            }), console.log("data.channel", i.data.channel), e.next = 11, i.createCanvas(t, a);
          case 11:
            return e.next = 13, i.loaderImg(o.landImgArr);
          case 13:
            return i.loaderEndImg = e.sent, console.log("loaderEndImg:", i.loaderEndImg), e.next = 17, i.createLand((0, r.createpx2rpx)(t), (0, r.createpx2rpx)(a));
          case 17:
            i.addLandEvent(), i.isRender = !0, i.landAnimate(), i.isGuide || (i.showMoveAnimation = !0, i.setData({
              isGuideShow: !0
            })), i.setData({
              isShowRenderBg: !1
            }), wx.hideLoading({});
          case 23:
          case "end":
            return e.stop()
        }
      }), n)
    })))()
  },
  createCanvas: function (t, a) {
    var e = this;
    return new Promise((function (n, o) {
      var d = t,
        l = a,
        h = (0, r.createpx2rpx)(d),
        c = (0, r.createpx2rpx)(l);
      e.stageWidth = h, e.stageHeight = c, console.log("create canvas----"), wx.createSelectorQuery().select("#land").node({
        node: !0,
        size: !0
      }).exec((function (t) {
        t[0] || o();
        var a = t[0].node;
        a.getContext("webgl", {
          stencil: !0
        }), a.width = d, a.height = l, u = (0, i.createPIXI)(a, e.stageWidth), (0, s.default)(u), e.renderer = u.autoDetectRenderer({
          width: e.stageWidth,
          height: e.stageHeight,
          transparent: !0,
          premultipliedAlpha: !0,
          view: a
        }), e.stage = new u.Container, e.canvas = a, n()
      }))
    }))
  },
  loaderImg: function (t) {
    return new Promise((function (a, e) {
      t.map((function (t) {
        return u.Loader.shared.resources[t.name] ? u.Loader.shared.resources[t.name] : u.Loader.shared.add(t.name, t.url)
      })), u.Loader.shared.load((function (t, e) {
        a(e)
      }))
    }))
  },
  landAnimate: function () {
    this.isRender && (this.updateLandMove(), this.renderer.render(this.stage), this.canvas.requestAnimationFrame(this.landAnimate.bind(this)))
  },
  updateLandMove: function () {
    if (this.land && this.land.bgContainer && this.land.bg && this.land.bgCover) {
      if (this.land.bgContainer.dragging && "move" == this.land.touchMode && (this.updateFram(this.land.bg.texture, this.land.movePos), this.updateFram(this.land.bgCover.texture, this.land.movePos)), this.land.bgMask && this.showMaskAnimation) {
        var t = Date.now(),
          a = .5 * Math.sin(.003 * t) + .5;
        this.land.bgMask.alpha = a
      }
      this.showMoveAnimation && (this.land.movePos.x -= 3, this.updateFram(this.land.bg.texture, this.land.movePos), this.land.movePos.x <= -o.startPosConfig[1].startX && (this.showMoveAnimation = !1, this.showMaskAnimation = !0, this.setData({
        showGuideHand: !1
      })))
    }
  },
  updateFram: function (t, a) {
    t.frame.x = -a.x, t.frame.y = -a.y, t.updateUvs()
  },
  createLand: function (t, a) {
    this.land = {}, this.land.audio = null, this.land.keyName = "", this.land._canvasWidth = t, this.land._canvasHeight = a, this.land.showMask = !1, this.land.touchMode = "", this.landMoveAnimationPos = {
      x: this.isGuide ? 0 : o.startPosConfig[1].moveX,
      y: this.isGuide ? 0 : o.startPosConfig[1].moveY
    }, this.landTextureStartPos = {
      x: o.startPosConfig[1].startX - this.landMoveAnimationPos.x,
      y: o.startPosConfig[1].startY - this.landMoveAnimationPos.y
    }, this.land.movePos = {
      x: -this.landTextureStartPos.x,
      y: -this.landTextureStartPos.y
    }, this.land.moveStartPos = {
      x: 0,
      y: 0,
      zoom: 1
    }, this.land.startTime = 0, this.land.scaleTouch = {
      touch1: {
        x: 0,
        y: 0
      },
      touch2: {
        x: 0,
        y: 0
      },
      zoom: 1
    }, this.land.bgContainer = new u.Container, this.land.bgContainer.interactive = !0, this.land.bounds = {
      top: 0,
      left: 0,
      right: 0,
      bottom: 0
    }, this.land.zoom = 1, this.land.bgContainer.scale.set(this.land.zoom), this.land.bounds = this.getBounds(this.loaderEndImg.bg.texture.baseTexture, this.stageWidth, this.stageHeight, this.land.zoom, {
      x: this.stageWidth / 2,
      y: this.stageHeight / 2
    }, this.land.bounds), this.land.bg = new u.Sprite(this.loaderEndImg.bg.texture), this.land.bg.texture.frame = new u.Rectangle(this.landTextureStartPos.x, this.landTextureStartPos.y, t, a), this.isGuide || (this.land.bgMask = new u.Sprite(this.loaderEndImg.bg_mask.texture), console.log("mask", this.land.bgMask), this.land.bgMask.texture.frame = new u.Rectangle(this.landTextureStartPos.x + this.landMoveAnimationPos.x, this.landTextureStartPos.y + this.landMoveAnimationPos.y, t, a), this.land.bgMask.alpha = 0), this.land.bgCover = new u.Sprite(this.loaderEndImg.bg_cover.texture), this.land.bgCover.texture.frame = new u.Rectangle(this.landTextureStartPos.x + this.landMoveAnimationPos.x, this.landTextureStartPos.y + this.landMoveAnimationPos.y, t, a), this.land.bgCoverCopy = new u.Sprite(this.loaderEndImg.bg_copy.texture), this.land.bgCoverCopy.texture.frame = new u.Rectangle(0, 0, t, a), this.land.bgContainer.addChild(this.land.bgCover), this.land.bgContainer.addChild(this.land.bgCoverCopy), this.land.bgContainer.addChild(this.land.bg), this.land.bgMask && this.land.bgContainer.addChild(this.land.bgMask), this.stage.addChild(this.land.bgContainer)
  },
  createLandAudio: function () {
    var t = this;
    this.land.audio ? this.landAudioState(!this.data.isLandAudioPlay) : (console.log("create audio"), this.setData({
      isLandAudioLoading: !0
    }), this.land.audio = wx.createInnerAudioContext(), this.land.audio.src = this.data.land.audioSrc, this.land.audio.onCanplay((function () {
      console.log("audio canplay!"), t.land.audio.play(), t.land.audio.offCanplay()
    })), this.land.audio.onEnded((function () {
      t.setData({
        isLandAudioPlay: !1
      })
    })), this.land.audio.onTimeUpdate((function () {
      console.log(t.land.audio.currentTime), t.land.audio.currentTime >= .3 && (t.setData({
        isLandAudioLoading: !1,
        isLandAudioPlay: !0
      }), t.land.audio.offTimeUpdate())
    })))
  },
  landAudioState: function (t) {
    if (this.data.isLandAudioLoading) return !1;
    t ? (console.log("audio play!"), this.land.audio.play()) : this.land.audio.pause(), this.setData({
      isLandAudioPlay: t
    })
  },
  addLandEvent: function () {
    this.land.bgContainer.on("pointerdown", this.landTouchStatrHandler), this.land.bgContainer.on("pointerup", this.landTouchEndHandler), this.land.bgContainer.on("pointermove", this.landTouchMoveHandler), this.land.bgContainer.on("pointertap", this.landTouchTapHandler)
  },
  getCoverPixelsData: function (t, a) {
    var e = this.renderer.extract.pixels(this.land.bgCover),
      n = parseInt(4 * (parseInt(a, 10) * parseInt(this.land.bgCover.getLocalBounds().width, 10) + parseInt(t, 10)), 10);
    return console.log("index", n), {
      r: e[n + 0],
      g: e[n + 1],
      b: e[n + 2],
      a: e[n + 3]
    }
  },
  guideHideHandler: function () {
    if (this.showMoveAnimation) return !1;
    this.land.bgMask.alpha = 0, this.showMaskAnimation = !1, this.setData({
      isGuideShow: !1
    }), wx.setStorageSync("isGuide", 1)
  },
  createGuideMask: function (t) {},
  createMask: function (t) {
    var a = this.renderer.generateTexture(this.land.bgCover),
      e = o.baseArae[t].araeRGB;
    if (!e) return !1;
    var n = new u.Filter(null, d.copyTextureFrag, {
      copyTexture: a,
      maskNum: .7,
      arae: [e.r, e.g, e.b]
    });
    this.land.bgCoverCopy.filters = [n];
    var i = this.renderer.generateTexture(this.land.bgCoverCopy),
      s = new u.Filter(null, d.maskTextureFrag, {
        masktex: i,
        mask: 1
      });
    this.land.shader = s, this.land.bgContainer.filters = [s]
  },
  landTouchTapHandler: function (t) {
    if (this.showMoveAnimation || this.data.isGuideShow || this.data.isSubmitShow || this.data.isMsgShow) return !1;
    if ((new Date).getTime() - this.land.startTime > 200) return !1;
    var e = t.data.global,
      n = e.x,
      i = e.y,
      s = this.getCoverPixelsData(n, i),
      o = s.r,
      r = s.g,
      d = s.b,
      l = (s.a, n < this.stageWidth / 2 ? "right" : "left"),
      h = null;
    if (0 != o || 0 != r || 0 != d) {
      this.land.showMask = !0;
      for (var u = 0, c = Object.keys(this.landData); u < c.length; u++) {
        var g = c[u];
        if (o == this.landData[g].baseAraeRGB.r && r == this.landData[g].baseAraeRGB.g && d == this.landData[g].baseAraeRGB.b) {
          h = g, this.land.keyName = h;
          break
        }
      }
      if (console.log("keyName:", h), null == h) return this.land.showMask = !1, !1;
      this.createMask(h), this.setData({
        land: a({}, this.landData[h]),
        isMsgShow: !0,
        isShowClose: !0,
        msgBoxClassName: l
      });
      try {
        wx.reportAnalytics("btn_land_check_msg", {
          title: this.landData[h].title
        })
      } catch (t) {
        console.log(t)
      }
    }
  },
  landTouchStatrHandler: function (t) {
    if (this.showMoveAnimation || this.data.isGuideShow || this.data.isSubmitShow || this.data.isMsgShow) return !1;
    if (this.land.startTime = (new Date).getTime(), t.data.originalEvent.touches.length >= 2) return !1;
    this.land.bgContainer.dragging = !0, this.land.touchMode = "move";
    var a = t.data.global,
      e = a.x,
      n = a.y;
    this.land.moveStartPos.x = parseInt(e - this.land.movePos.x, 10), this.land.moveStartPos.y = parseInt(n - this.land.movePos.y, 10)
  },
  landTouchMoveHandler: function (t) {
    if (this.showMoveAnimation || this.land.showMask || this.data.isGuideShow || this.data.isSubmitShow || this.data.isMsgShow) return !1;
    if (t.data.originalEvent.touches.length >= 2) return !1;
    if (this.land.bgContainer.dragging) {
      var a = t.data.global,
        e = a.x,
        n = a.y,
        i = e - this.land.moveStartPos.x,
        s = n - this.land.moveStartPos.y;
      this.land.movePos.x = Math.min(Math.max(i, this.land.bounds.right), this.land.bounds.left), this.land.movePos.y = Math.min(Math.max(s, this.land.bounds.bottom), this.land.bounds.top)
    }
  },
  landTouchEndHandler: function (t) {
    if (this.showMoveAnimation || this.land.showMask || this.data.isGuideShow || this.data.isSubmitShow || this.data.isMsgShow) return !1;
    this.land.bgContainer.dragging = !1, this.land.touchMode = ""
  },
  getBounds: function (t, a, e, n, i, s) {
    var o = t.width,
      r = t.height;
    i.x, i.y;
    return {
      top: 0,
      left: 0,
      right: -(o - a / n),
      bottom: -(r - e / n)
    }
  },
  touchStartEvent: function (t) {
    if (!this.data.isLogin && !this.data.isRender) return !1;
    u.dispatchEvent(t)
  },
  touchMoveEvent: function (t) {
    if (!this.data.isLogin && !this.data.isRender) return !1;
    u.dispatchEvent(t)
  },
  touchEndEvent: function (t) {
    if (!this.data.isLogin && !this.data.isRender) return !1;
    u.dispatchEvent(t)
  },
  touchCancelEvent: function (t) {
    if (!this.data.isLogin && !this.data.isRender) return !1;
    u.dispatchEvent(t)
  },
  loginHandler: function () {
    var t = this;
    return n(e.default.mark((function a() {
      return e.default.wrap((function (a) {
        for (;;) switch (a.prev = a.next) {
          case 0:
            return a.next = 2, (0, l.wxlogin)();
          case 2:
            if (a.sent) {
              a.next = 5;
              break
            }
            return a.abrupt("return", !1);
          case 5:
            t.setData({
              isLogin: !0
            }), t.showLand();
          case 7:
          case "end":
            return a.stop()
        }
      }), a)
    })))()
  },
  closeHandler: function (t) {
    console.log("close"), this.land.shader && (this.land.shader.uniforms.mask = 0), this.land.showMask = !1, this.land.audio && (this.land.audio.destroy(), this.land.audio = null), this.setData({
      isMsgShow: !1,
      isShowClose: !1,
      isLandAudioPlay: !1,
      isLandAudioLoading: !1
    })
  },
  numAddHandler: function () {
    var t = this.data.inputNum;
    t += 10, this.setInputNun(t)
  },
  numSubHandler: function () {
    var t = this.data.inputNum;
    t -= 10, this.setInputNun(t)
  },
  keyInputHandler: function (t) {
    this.setInputNun(Number(t.detail.value))
  },
  setInputNun: function (t) {
    var a = this.data.land.buy_max_limit;
    t > a && (t = a, wx.showToast({
      title: "一次最多购买".concat(a, "平米！"),
      icon: "none",
      duration: 1500,
      mask: !0
    })), t > this.data.maxNum && (t = this.data.maxNum), t <= 0 && (t = 0), this.setData({
      inputNum: Number(t)
    })
  },
  backHandler: function () {
    this.setData({
      isSubmitShow: !1,
      isBlank: !1,
      isShowBack: !1,
      isShowClose: !0
    }), this.isReload && (this.onHide(), this.showLand())
  },
  confirmHandler: function () {
    this.setData({
      isSubmitShow: !0,
      isBlank: !0,
      isShowBack: !0,
      isShowClose: !1,
      inputNum: 10,
      isLandAudioPlay: !1,
      isLandAudioLoading: !1
    }), this.land.audio && (this.land.audio.destroy(), this.land.audio = null);
    try {
      wx.reportAnalytics("btn_land_select", {
        title: this.data.land.title
      })
    } catch (t) {
      console.log(t)
    }
  },
  submitHandler: function () {
    var t = this;
    if (console.log("submit!"), this.data.inputNum < this.data.land.buy_min_limit) return wx.showToast({
      title: "最少认养".concat(this.data.land.buy_min_limit, "平米！"),
      icon: "none",
      duration: 1500,
      mask: !0
    });
    console.log("num:", this.data.inputNum), wx.showLoading({
      title: "订单锁定中",
      mask: !0
    });
    var e = (0, r.random)(o.randomShareNum.min, o.randomShareNum.max),
      n = ("".concat(o.cdnImgPrefix, "/share-img/share_").concat(e, ".jpg"), {
        bgName: e,
        bgCoverName: e,
        from: c.globalData.fromArea
      }),
      i = JSON.stringify(n);
    (0, h.preOrderLockAPI)({
      farm_id: this.data.land.id,
      quota: this.data.inputNum,
      share_tpl: i
    }).then((function (e) {
      console.log("Lockres:", e);
      wx.navigateTo({
        url: "./land-order/index",
        success: function (n) {
          n.eventChannel.emit("acceptDataFromOpenerPage", a(a(a({}, t.data.land), e), {}, {
            inputNum: t.data.inputNum,
            addr: null,
            share_img: i
          }))
        }
      })
    })).catch((function (a) {
      return console.log(a), wx.hideLoading(), a.data && -1 !== a.data.msg.indexOf("请求太频繁") ? wx.showToast({
        title: "请求太频繁",
        icon: "error",
        duration: 1e3
      }) : a.errorMsg && "1004" == a.errorMsg ? (t.isReload = !0, t.data.land.v_quota - t.data.land.sold_quota > 0 ? wx.showToast({
        title: "库存紧张请稍后",
        icon: "error",
        duration: 1e3
      }) : wx.showToast({
        title: "农田已售完！",
        icon: "error",
        duration: 1e3
      })) : wx.showToast({
        title: "订单锁定失败！",
        icon: "error",
        duration: 1e3
      })
    }));
    try {
      wx.reportAnalytics("btn_land_submit", {
        title: this.data.land.title
      })
    } catch (t) {}
  },
  landDestroy: function () {
    try {
      this.land.bgCoverCopy.destroy(), this.land.bg.destroy(), this.land.bgCover.destroy(), this.land.bgMask && this.land.bgMask.destroy(), this.land.bgContainer.destroy({
        children: !0,
        texture: !0,
        baseTexture: !0
      }), this.stage && this.stage.destroy(), this.renderer = null, this.canvas = null, this.isRender = !1, u = null
    } catch (t) {
      console.log(t)
    }
  }
});